﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace GSBA.Common
{
    public class NavigationCommand<T> : ICommand
    {
        private Action<T> callback;

        public NavigationCommand(Action<T> callback)
        {
            this.callback = callback;
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public void Execute(object parameter)
        {
            if (this.callback != null)
            {
                this.callback((T)parameter);
            }
        }

        public event EventHandler CanExecuteChanged;
    }
}
